#pragma once

#define ASM_NL ;
#define ALIGN .align 4, 0x90

#ifndef ENTRY
#define ENTRY(name)    \
    .globl name ASM_NL \
        ALIGN ASM_NL   \
            name:
#endif

#ifndef END
#define END(name) \
    .size name, .- name
#endif

/* If symbol 'name' is treated as a subroutine (gets called, and returns)
 * then please use ENDPROC to mark 'name' as STT_FUNC for the benefit of
 * static analysis tools such as stack depth analyzer.
 */
#ifndef ENDPROC
#define ENDPROC(name)            \
    .type name, @function ASM_NL \
                    END(name)
#endif